/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jdbcmigration;

import java.sql.Connection;
import java.sql.ResultSet;

/**
 *
 * @author tkm
 */
abstract class JDBCDatabase {

    String h;
    String p;
    String d;
    String user;
    String pass;
    Table[] tables;
    boolean state;
    Connection connection;

    public JDBCDatabase(String host, String port, String database, String duser, String dpassword, boolean pstate, Connection conn) {
        h = host;
        p = port;
        d = database;
        user = duser;
        pass = dpassword;
        tables = null;
        state = pstate;
        connection = conn;
    }

    abstract Table[] getTables(String database);

    abstract void open();

    abstract void close();

    abstract void MigrationTo(JDBCDatabase jDatabase);

    abstract void newDatabase(String dabase);

    abstract void dropDatabaseIfExist(String dabase);

    abstract void useDatabase(String database);

    abstract void insertTableContent(Table table, ResultSet sourceResultSet);
    void clearDataBase()
    {
        d = "";
    }
}
